package aiP.A3.FertigungKomponente.DataAccessLayer.Entity;

import aiP.A3.PersistenceService.iEntity;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.sql.Timestamp;

/**
 * Created with IntelliJ IDEA.
 * User: Hero
 * Date: 22.05.14
 * Time: 13:51
 * To change this template use File | Settings | File Templates.
 */
@javax.persistence.Table(name = "AI_BAUTEIL_STUECKLISTE", schema = "AIP", catalog = "")
//@javax.persistence.Table(name = "AI_BAUTEIL_STUECKLISTE", schema = "HR", catalog = "")
@Entity
public class BauteilStueckliste implements iEntity {
    private int stuecklisteNr;

    @javax.persistence.Column(name = "STUECKLISTE_NR")
    @Id
    public int getStuecklisteNr() {
        return stuecklisteNr;
    }

    public void setStuecklisteNr(int stuecklisteNr) {
        this.stuecklisteNr = stuecklisteNr;
    }

    private Timestamp gueltigAb;

    @javax.persistence.Column(name = "GUELTIG_AB")
    @Basic
    public Timestamp getGueltigAb() {
        return gueltigAb;
    }

    public void setGueltigAb(Timestamp gueltigAb) {
        this.gueltigAb = gueltigAb;
    }

    private Timestamp gueltigBis;

    @javax.persistence.Column(name = "GUELTIG_BIS")
    @Basic
    public Timestamp getGueltigBis() {
        return gueltigBis;
    }

    public void setGueltigBis(Timestamp gueltigBis) {
        this.gueltigBis = gueltigBis;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        BauteilStueckliste that = (BauteilStueckliste) o;

        if (stuecklisteNr != that.stuecklisteNr) return false;
        if (gueltigAb != null ? !gueltigAb.equals(that.gueltigAb) : that.gueltigAb != null) return false;
        if (gueltigBis != null ? !gueltigBis.equals(that.gueltigBis) : that.gueltigBis != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = stuecklisteNr;
        result = 31 * result + (gueltigAb != null ? gueltigAb.hashCode() : 0);
        result = 31 * result + (gueltigBis != null ? gueltigBis.hashCode() : 0);
        return result;
    }
}
